package shiro.com.service.sys.impl;

import java.util.List;
import java.util.Map;
import java.util.Set;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import shiro.com.domain.sys.SysResoureTest;
import shiro.com.domain.sys.SysRoleTest;
import shiro.com.mapper.sys.SysRoleTestMapper;
import shiro.com.service.sys.ISysRoleTestService;
import shiro.com.service.sys.ISysUsersService;

/**
 * 【请填写功能名称】Service业务层处理
 *
 * @author ruoyi
 * @date 2022-11-01
 */
@Service
public class SysRoleTestServiceImpl implements ISysRoleTestService
{
    @Autowired
    private SysRoleTestMapper sysRoleTestMapper;
    @Autowired
    private ISysUsersService usersService;
    /**
     * 查询【请填写功能名称】
     *
     * @param sysRoleId 【请填写功能名称】主键
     * @return 【请填写功能名称】
     */
    @Override
    public SysRoleTest selectSysRoleTestBySysRoleId(Long sysRoleId)
    {
        return sysRoleTestMapper.selectSysRoleTestBySysRoleId(sysRoleId);
    }
    @Override
    public List<SysResoureTest> selectSysRoleTestBySysRoleArray(Long[] sysRoleId)
    {
        return sysRoleTestMapper.selectSysRoleTestBySysRoleArray(sysRoleId);
    }

    /**
     * 查询【请填写功能名称】列表
     *
     * @param sysRoleTest 【请填写功能名称】
     * @return 【请填写功能名称】
     */
    @Override
    public List<SysRoleTest> selectSysRoleTestList(SysRoleTest sysRoleTest)
    {
        return sysRoleTestMapper.selectSysRoleTestList(sysRoleTest);
    }

    /**
     * 新增【请填写功能名称】
     *
     * @param sysRoleTest 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int insertSysRoleTest(SysRoleTest sysRoleTest)
    {
        return sysRoleTestMapper.insertSysRoleTest(sysRoleTest);
    }

    /**
     * 修改【请填写功能名称】
     *
     * @param sysRoleTest 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int updateSysRoleTest(SysRoleTest sysRoleTest)
    {
        return sysRoleTestMapper.updateSysRoleTest(sysRoleTest);
    }

    /**
     * 批量删除【请填写功能名称】
     *
     * @param sysRoleIds 需要删除的【请填写功能名称】主键
     * @return 结果
     */
    @Override
    public int deleteSysRoleTestBySysRoleIds(Long[] sysRoleIds)
    {
        return sysRoleTestMapper.deleteSysRoleTestBySysRoleIds(sysRoleIds);
    }

    /**
     * 删除【请填写功能名称】信息
     *
     * @param sysRoleId 【请填写功能名称】主键
     * @return 结果
     */
    @Override
    public int deleteSysRoleTestBySysRoleId(Long sysRoleId)
    {
        return sysRoleTestMapper.deleteSysRoleTestBySysRoleId(sysRoleId);
    }

    @Override
    public List<SysResoureTest> loadUserResources(Map<String, Object> map) {
        List<Long> longs = usersService.selectListId(map);
        Long[] longs1 = (Long[])longs.toArray();
        List<SysResoureTest> sysResoureTestList = sysRoleTestMapper.selectSysRoleTestBySysRoleArray(longs1);
        return sysResoureTestList;
    }
    @Override
    public Set<String> selectSysRoleTestByUserName(String userName){
        return sysRoleTestMapper.selectSysRoleTestByUserName(userName);
    }
}
